/**
*  
* @Function 共享申请枚举 
* @ProjectName credit-data-platform 
* @PackageName com.py.credit.entity.enums    
* @FileName ShareApplyFieldsEnum.java    
* @Date 2018年9月11日下午3:02:13
* @Author Min DongXv
* @Copyright (c) 2018, 金电联行 All Rights Reserved.   
*   
*/  
package com.py.credit.entity.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.py.credit.entity.common.OptionalColumn;

/**
 * 
 * @Function 共享申请枚举
 * @ClassName ShareApplyFieldsEnum
 * @Date 2018年9月11日 下午3:02:13
 * @Author Min DongXv
 * 
 */
public enum ShareCustomizeFieldsEnum {

	DEPTNAME("deptName", "申请部门", "varchar", "input", true, false, new HashMap<String, String>(), false, false),
	APPLYCONTENT("applyContent", "申请事由", "varchar", "input", true, false, new HashMap<String, String>(), false, false),
	SHAREDATE("shareDate", "共享期限", "datetime", "input", true, false, new HashMap<String, String>(), false, false),
	MANAGERNAME("managerName", "操作人", "varchar", "input", true, false, new HashMap<String, String>(), false, false),
	UPDATETIME("updateTime", "更新时间", "datetime", "input", true, false, new HashMap<String, String>(), false,
			false), CUSTOMIZESTATUS("customizeStatus", "定制状态", "varchar", "select", true, false,
					new HashMap<String, String>() {
						private static final long serialVersionUID = 2599163589014847559L;
						{
							put("W", "未定制");
							put("R", "定制中");
							put("Q", "已截止");
						}

					}, true, true);
	private String colNameEN;
	private String colNameCN;
	private String type;
	private boolean defaultShow;
	private boolean advanceConditionShow;
	private String widget;
	private boolean fuzzy;
	private HashMap<String, String> widgetValue;
	private boolean searchIsShow;

	private ShareCustomizeFieldsEnum(String colNameEN, String colNameCN, String type, String widget, boolean defaultShow,
			boolean fuzzy, HashMap<String, String> widgetValue, boolean advanceConditionShow, boolean searchIsShow) {
		this.colNameEN = colNameEN;
		this.colNameCN = colNameCN;
		this.type = type;
		this.widget = widget;
		this.defaultShow = defaultShow;
		this.fuzzy = fuzzy;
		this.widgetValue = widgetValue;
		this.advanceConditionShow = advanceConditionShow;
		this.searchIsShow = searchIsShow;
	}

	public String getColNameEN() {
		return colNameEN;
	}

	public void setColNameEN(String colNameEN) {
		this.colNameEN = colNameEN;
	}

	public String getColNameCN() {
		return colNameCN;
	}

	public void setColNameCN(String colNameCN) {
		this.colNameCN = colNameCN;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public boolean isDefaultShow() {
		return defaultShow;
	}

	public void setDefaultShow(boolean defaultShow) {
		this.defaultShow = defaultShow;
	}

	public HashMap<String, String> getWidgetValue() {
		return widgetValue;
	}

	public void setWidgetValue(HashMap<String, String> widgetValue) {
		this.widgetValue = widgetValue;
	}

	public String getWidget() {
		return widget;
	}

	public void setWidget(String widget) {
		this.widget = widget;
	}

	public boolean isFuzzy() {
		return fuzzy;
	}

	public void setFuzzy(boolean fuzzy) {
		this.fuzzy = fuzzy;
	}

	public boolean isAdvanceConditionShow() {
		return advanceConditionShow;
	}

	public void setAdvanceConditionShow(boolean advanceConditionShow) {
		this.advanceConditionShow = advanceConditionShow;
	}

	public boolean isSearchIsShow() {
		return searchIsShow;
	}

	public void setSearchIsShow(boolean searchIsShow) {
		this.searchIsShow = searchIsShow;
	}

	public static List<OptionalColumn> getOptionalColumns() {
		List<OptionalColumn> OptionalColumns = new ArrayList<OptionalColumn>();
		ShareCustomizeFieldsEnum[] values = ShareCustomizeFieldsEnum.values();
		for (ShareCustomizeFieldsEnum value : values) {
			OptionalColumn optionalColumn = new OptionalColumn(value.getColNameEN(), value.getColNameCN(),
					value.getType(), value.isDefaultShow(), value.getWidget(), value.isFuzzy(), value.getWidgetValue(),
					value.isSearchIsShow());
			OptionalColumns.add(optionalColumn);
		}
		return OptionalColumns;
	}

	public static List<OptionalColumn> getAdvancedConditionColumns() {
		List<OptionalColumn> OptionalColumns = new ArrayList<OptionalColumn>();
		ShareCustomizeFieldsEnum[] values = ShareCustomizeFieldsEnum.values();
		for (ShareCustomizeFieldsEnum value : values) {
			if (value.isAdvanceConditionShow()) {
				OptionalColumn optionalColumn = new OptionalColumn(value.getColNameEN(), value.getColNameCN(),
						value.getType(), value.isDefaultShow(), value.getWidget(), value.isFuzzy(),
						value.getWidgetValue(), value.isSearchIsShow());
				OptionalColumns.add(optionalColumn);
			}
		}
		return OptionalColumns;
	}

	public static List<String> getDefaultShowColumnEN() {
		List<String> columns = new ArrayList<String>();
		ShareCustomizeFieldsEnum[] values = ShareCustomizeFieldsEnum.values();
		for (ShareCustomizeFieldsEnum value : values) {
			if (value.isDefaultShow()) {

				columns.add(value.getColNameEN());
			}
		}
		return columns;
	}
}
